
import bpy


class C_ops_创建Collection(bpy.types.Operator):
	bl_idname = 'node.update_node_create_collection'
	bl_label = '创建Collection'
	bl_options = {'REGISTER', 'UNDO'}

	m_名称 = bpy.props.StringProperty(name='渲染层')
	
	def execute(self, context):
		col = bpy.data.collections.new(self.m_名称)
		context.scene.collection.children.link(col)
		return {'FINISHED'}




def f_对象从容器中断开(渲染层容器):
	临时容器 = []

	原数据数量 = len(渲染层容器.objects)
	#print('原数据数量 = ', 原数据数量)
	for obj in 渲染层容器.objects:
		临时容器.append(obj)
	
	for obj in 临时容器:
		obj.name == '____temp____' + obj.name
		渲染层容器.objects.unlink(obj)
	
	渲染层容器.objects.update()

	return 临时容器






classes = (
	C_ops_创建Collection,
)




def register():
	for c in classes:
		bpy.utils.register_class(c)
		

def unregister():
	for c in classes:
		bpy.utils.unregister_class(c)


if __name__ == "__main__":
	register()
#print('update_node_create_collection--')
